import axios from 'utils/axios.js'

// 获取课程信息
export function getCourseList (form, query) {
  return axios.post(`/course/anon/list?page=${query.page}&limit=${query.limit}`, form)
}
// 获取课程详情
export function getCourseDetail (id) {
  return axios.get(`/course/${id}`)
}
export function addCourse(form) {
  return axios.post(`/course`, form)
}
export function delCourse (id) {
  return axios.delete(`/course/${id}`)
}
export function updateCourse (form) {
  return axios.put(`/course`, form)
}
export function getCommentByType (type, id) {
  return axios.get(`/comment/findByTypeId?type=${type}&id=${id}`)
}
export function addComment(comment) {
  return axios.post(`/comment/anon/`, comment)
}
